﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Zuoye
{
    public partial class Index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public string InitUser()
        {
            if (Session["User"] == null)
                return "";
            DataRow userRow = (DataRow)Session["User"];
            string genderText = userRow["gender"].ToString() == "0" ? "男" : "女";
            //登录人信息
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append("<div class=\"segment left\">");
            stringBuilder.Append("<i class=\" glyphicon glyphicon-user left\"></i>");
            stringBuilder.Append($"     <h3 class=\"left\">欢迎{userRow["account"]}登录<br>");
            stringBuilder.Append("  <span>管理这个设备及其传感器</span>");
            stringBuilder.Append("  </h3>");
            stringBuilder.Append(" </div>");
            stringBuilder.Append("<div class=\"clear\"></div>");
            stringBuilder.Append("  <div class=\"segment2\">");
            stringBuilder.Append("  <div class=\"user_left\">");
            stringBuilder.Append($"  <img width=\"160\" height=\"160\" src=\"{userRow["img_url"]}\">");
            stringBuilder.Append("  </div>");
            stringBuilder.Append(" <div class=\"user_right\">");
            stringBuilder.Append($"<h5>你好：{userRow["account"]}<br>");
            stringBuilder.Append($" <span><i class=\"glyphicon glyphicon-time\"></i>&nbsp;{DateTime.Now}</span>");
            stringBuilder.Append("    </h5>");
            stringBuilder.Append("<p>");
            stringBuilder.Append($"  所在地:{userRow["city_name"]}<br>");
            stringBuilder.Append($"性别:{genderText}<br>");
            stringBuilder.Append($"  QQ:{userRow["qq"]}<br>");
            stringBuilder.Append($"    邮箱：{userRow["email"]}");
            stringBuilder.Append("  </p>");
            stringBuilder.Append("</div>");
            stringBuilder.Append("</div>");
            return stringBuilder.ToString();


        }
        public void InitNote()
        {

        }
    }
}